Disorders of perception, attention, and memory frequently accompany the major mental diseases. To understand the neural mechanisms of these mental processes, we are recording the activity of neurons in the extrastriate and prefrontal cortex of monkeys engaged in tasks requiring visual discrimination, attention, and memory. There appear to be at least two fundamentals types of neuronal memory mechanisms in the cortex. One is engaged automatically by any sensory input. As one gains experience with new stimuli, the pool of activated cells in inferior temporal cortex shrinks to just those cells carrying the most critical information, providing a possible basis for long-term memory. The other mechanism is an active, or voluntary, one that is engaged in tasks requiring working memory. When animals hold an expected stimulus "in mind", cells in prefrontal cortex shift into a state of maintained activity, priming cells in inferior temporal cortex to give a potentiated response when the expected stimulus appears. Both memory mechanisms also serve to bias attention towards objects in the visual field that are novel, behaviorally relevant, or associated with reward. These attentional shifts appear to result from competitive interactions among identified populations of cells in visual cortex, extending back into early visual areas such as area V2.